

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>

static void showStr(char *tag, ...)
{

    printf("tag:%s\n", tag);

    char *value;
    va_list va;
    va_start(va, tag);
    while ((value = va_arg(va, char *)) != 0)
    {
        printf("value:%s\n", value);
    }
    va_end(va);
}

int main(int agrc, char *argv[])
{

    //showStr("TAG","zhangsan","lisi","wangwu");

    printf("before execl!\n");

    // ls -al
    int ret = execlp("ls","ls","-a","-l",NULL);
    printf("结果为: %d\n",ret);
    return 0;
}